package com.ce.pms.renovation.dao.impl;

import org.hibernate.Query;

import com.ce.pms.renovation.dao.IInspectionViolationDao;
import com.ce.pms.renovation.model.InspectionViolationDO;
import com.ce.pms.renovation.model.RenovateViolationDO;

/**
 * 名称: com.ce.pms.renovation.dao.impl.InspectionViolationDaoImpl
 * 验收期违规DAO实现类
 *
 * @author  许心炜  <br>
 * Created on： 2008-12-19 <br>
 * @author <br>
 * update on： <br>
 * why: <br>
 */

public class InspectionViolationDaoImpl extends AbstractViolationDaoImpl implements IInspectionViolationDao{

	/**
	* 获得验收期违规记录
	* @author 许心炜
	* @param abstractInspectionId - 抽象装修验收ID
	* @return InspectionViolationDO
	*/
	public InspectionViolationDO getInspectionViolation(Long abstractInspectionId) {
		String hql = " from InspectionViolationDO ins where ins.inspection.keyword = ? ";
		Query query = this.createQuery(hql, abstractInspectionId);

		if(query.list().size() > 0) {
			return  (InspectionViolationDO) query.list().get(0);
		}else {
			return null;
		}

	}
}
